package com.base.cn.platform.os.service.exam.extend;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.exam.ExamBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 用户考试扩展数据接口
 *
 * @author s.li
 * @create 2018-06-27-16:12
 */
@FeignClient(name = ExamBaseService.appName ,configuration = FeignAuthConfig.class)
public interface ExamUserExpandService extends ExamBaseService {

    /**
     * 获取用户的考试扩展数据
     * @param userId 用户ID
     * @return ExamUserExpand
     */
    @RequestMapping(contextPath + "/findExamUserExpandByUserId")
    Map<String,Object> findExamUserExpandByUserId(@RequestParam("userId") BigDecimal userId);

    /**
     * 保存用户自由组卷规则
     * @param customMap 规则Map
     * @param userId 用户ID
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/saveExamUserExpandCustom")
    Map<String,Object> saveExamUserExpandCustom(@RequestBody Map<String, Object> customMap,
                                                @RequestParam("userId") BigDecimal userId);

    /**
     *  加载用户考试数据基础统计
     * @param userId 用户ID
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/getUserExamBaseCount")
    Map<String,Object> getUserExamBaseCount(@RequestParam("userId") BigDecimal userId);

    /**
     * 加载用户薄弱点数据
     * @param userId 用户ID
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/getUserWeakness")
    Map<String,Object> getUserWeakness(@RequestParam("userId") BigDecimal userId);

    /**
     * 获取用户最后选择的专业
     * @param userId 用户ID
     * @return 专业ID串
     */
    @RequestMapping(contextPath + "/findUserLastSelectSubjectIds")
    String findUserLastSelectSubjectIds(@RequestParam("userId") BigDecimal userId);

    /**
     * 保存用户选择的专业/科目
     * @param userId 用户ID
     * @param subjectIds 专业ID串，【专业ID,科目ID】
      * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/saveExamSelectSubject")
    Map<String,Object> saveExamSelectSubject(@RequestParam("userId") BigDecimal userId,
                                             @RequestParam("subjectIds") String subjectIds);

    /**
     * 获取用户最后选择的专业
     * @param userId 用户ID
     * @return List<Map<String,Object>>专业列表
     */
    @RequestMapping(contextPath + "/findUserLastSelectSubjectList")
    List<Map<String,Object>> findUserLastSelectSubjectList(@RequestParam("userId") BigDecimal userId);
}
